<template>
	<view class="school_content">

		<rich-text :nodes="content"></rich-text>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: "",
				id: 0,
			}
		},
		onLoad(options) {
			if (options.id) {

				this.id = options.id,

				this.toequipmentinfo();
			}
		},
		methods: {
			toequipmentinfo: function() {

				uni.showLoading({
					title: '加载中...',
				})
				let that = this;

				this.$request.request('api/Equipment/toequipmentinfo?id=' + this.id + '&token=' + wx
					.getStorageSync('token'), '', 0, 'get', false).then(res => {

					let res2w = res.data;
					if (typeof res2w == 'string') {
						let str22 = res2w.replace(/\ufeff/g, ""); //去除反斜杠
						res2w = JSON.parse(str22); //string转object
					}
					if (res2w.status == 1) {
						const res2_data_data = res2w.data;
						const content = res2w.data.desc

						that.content = content


					} else if (res2w.status == -2) {

						uni.showToast({
							title: "" + res2w.msg,
							icon: 'none',
							duration: 3000,
							success: function() {

							}
						});
						uni.removeStorageSync('token');
						uni.removeStorageSync('isuser');

						setTimeout(() => {
							uni.redirectTo({
								url: '../login/login?redirect_page=equipementinfo&id=' +
									that.id,
							})
						}, 3000);

					} else {

						uni.showToast({
							title: "" + res2w.msg,
							icon: 'none',
							duration: 3000
						});

					}
					uni.hideLoading();
				})

			},
		}
	}
</script>

<style>
	page {}

	.school_content {
		display: flex;
		flex-direction: column;

		font-size: 16px;
		padding: 10px 5px;
	}

	.card {
		display: flex;
		flex-direction: column;
		border: 0px solid #d2d2d2;
		padding: 10px 10px;
		margin: 5px 0px;
		background-color: white;

	}

	p {
		font-family: Helvetica, sans-serif;
		color: #666;
		line-height: 1.8;
	}
</style>